package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @version v1.0
 * @auther: 子墨
 * @datetime: 2018/11/7 17:20
 * @description: 支付宝支付配置类
 */
public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓


    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号，上线时替换
    public static String app_id = "2016092000553026";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDMRA9MxY1a23g/BTsc1dTOFz3TENdHpA/PTmKX6Mx7d4zaZjPl2MPZho204+7zWq5OZkcougN5ROCT50N5AacqjA2aDX3ikdF9l6JU0pMY+lFnWB5IHobB3Bx7aLlT7eQBzTxTV0PlHxPNXX5VFXkdiNEFV1fD7LytvXokSUFIYKM/ASfUj0HvofnTZg347wzCLzqlueEJpMWX+bBKgsGWyG6nBD361hfB8UslE2JuJ9wwU6+IxA+5c112rJvvBcemNAQ63A/2aerU9eMA4D/5sfJK0ryOPj2cGMGi+SAyv1QjhlDx8S6S40NTek42ORyz4KfVwElHSUQaXBeMannXAgMBAAECggEAIDZPb1zsCLr5gH6zrr1t3L4/iqxqNqsBr0B+PdSBgqr8tGhPoNyJLiGQ8UjMouXW/RgV+q8y4wngnJJoyolfMk95yaR9CKDUN4kVGWlHtzWqZrC3vcnKmIG8oB2ItFqcjUgvTjlBxL0c41LuHD7Rpb2wsLXwaj5IFuH9hAFlYSNMGYkZYeOeaSI2k6SWuu/2OAW0TPK5BGaHdu3IkE2eDpveUblDLDDbqrXpb0ivUU3byMJNYlouL0kSv0INK5rGd/qtpSr3h4kdqi9eaDU6I27Qgg1bB/QQe78Avxh9PjGNRQbNDmPW+zJEbQeAJjdaoKuwXfgeu/QGGUBqLcx74QKBgQDn++7agsRZZBEhPcWa3Udt8nTSE+SkHnMKZ6ZeE95PyXve7jROdjs/I7W/8rgxNxKZHzRhyN78gjmmvxgMLAoTzH94+E+F1ftS2gFvUbaVOQw+Z0YzutvB6RmTH27Kh85UKtFtTmymXbElTfFh4VyS9NVAGvPbvH8jArfGB+/fBwKBgQDhaYjhBkSr1u0SmY+lbZPTOb8bWEQ1lW0iLAJifD38b2WnyKzwGes6nqOsjqv6TMcCv4bwTNkZBnJQFgJhy/ONJAMf1d3xIiy5iVVJ6Eq6BPbzTcquS53rvVBdv4cn2cl0hpaq4q8tWY1hSkYjZxRywkgXW934+MZ2RS551o0KsQKBgQC7WRPR9m+Z/Z1z6g4u/muUWI2NpzEsdcbUbVbHfWY5q29VX6xwfT1lxXIfnWaxoFdtv+yu1+l1pbnnd0Z1dg+BY9LCoE6guGoqxBMKksRQiOzhbMgeONcHKDhWP7la6Qhxos7VZtOKG/pXNTYupTD9IasjBWFRYU6PuL8vt/M5ewKBgQDgQM4ckM/g5YIV7xAp1Eos6lZmLfouFOruBDqbIF/KtEi+E7d5Z0/OkeTj10zhR2D2KvVkPBAABZnUcxELmoxC7oDtOygCra0xKJ/hV2iAiE/m3o21uSTzUvSRT+p2iwURGJTsjXkZ9O3izLHapsKBKSfvlUXQXC+Vml4SeJD5AQKBgQDSGlI5G9vhFfwh7oi3mpkTOyN/gftV/0AhwcqwIQrGQ2/gauVjA7/SnZthYsREs9n1bLGCvzC0UuoSuHIKiAMtKbo0IC1CZVa/h9Q4orR2OaxwCbyVRMknh6nuVUEar23US9iBvLMD4Qb2i5D/JDHNTFbcCtkrfsBCrk7+3HnaXg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzEQPTMWNWtt4PwU7HNXUzhc90xDXR6QPz05il+jMe3eM2mYz5djD2YaNtOPu81quTmZHKLoDeUTgk+dDeQGnKowNmg194pHRfZeiVNKTGPpRZ1geSB6Gwdwce2i5U+3kAc08U1dD5R8TzV1+VRV5HYjRBVdXw+y8rb16JElBSGCjPwEn1I9B76H502YN+O8Mwi86pbnhCaTFl/mwSoLBlshupwQ9+tYXwfFLJRNibifcMFOviMQPuXNddqyb7wXHpjQEOtwP9mnq1PXjAOA/+bHyStK8jj49nBjBovkgMr9UI4ZQ8fEukuNDU3pONjkcs+Cn1cBJR0lEGlwXjGp51wIDAQAB";


    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://www.zimo.wiki:8080/ZimoStore/pages/reception/order/payResult.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = notify_url;

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关，上线时替换
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
